home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_replaceenemy.cog < prev    next >
Text File  |  1999-11-15  |  1KB  |  61 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_ReplaceEnemy.cog
  4. #
  5. # Generic enemy replacer.
  6. # This works much like a generator, but its purpose is to replace
  7. # an vital/important/scenic enemy if it has been killed too early.
  8. #
  9. # [YB/CR]
  10. #
  11. # 7/10/97 - [CR] - Changed COG to use HasLOS verb
  12. #
  13. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  14. # ========================================================================================
  15.  
  16. symbols
  17. thing        replacer_pos        desc=replacer_ghost
  18. thing        player        local    
  19. template    enemy_tpl           desc=enemy_to_replace
  20.     int        delay=10.0        desc=delay_before_respawn
  21.  
  22.     int        enemy                  local
  23.  
  24.     message    startup
  25.     message    killed            mask=0xfff
  26. end
  27.  
  28. code
  29. # ........................................................................................
  30.  
  31. startup:
  32.    enemy = CreateThing(enemy_tpl, replacer_pos);
  33.     CaptureThing(enemy);    
  34.    Return;
  35.  
  36. # ........................................................................................
  37.  
  38. killed:
  39.    player = GetLocalPlayerThing();
  40.    Sleep(delay);
  41.  
  42.    if (HasLOS(replacer_pos, player))
  43.    {
  44.       CaptureThing(enemy);
  45.       return;
  46.    }
  47.  
  48.    if (HasLOS(player, replacer_pos))
  49.    {
  50.       CaptureThing(enemy);
  51.       return;
  52.    }
  53.  
  54.    enemy = CreateThing(enemy_tpl, replacer_pos);
  55.    CaptureThing(enemy);
  56.    return;
  57.  
  58. end
  59.  
  60.  
  61.